<div class="container">
	<div class="tabbable tabs-left" id="admin_bar">
		<%= render 'shared/admin_bar'%>
		<div class="tab-content">
			<div class="row-fluid">
				<h1 class="span12"> <%= t('bai_viet_trong_danh_muc__', :danh_muc => @danh_muc_ngon_ngu.ten)%> </h1>
			</div>
			<div class="row-fluid">
				<div class="span6">
					<a href="<%= url_for :action=> "tao_moi" %>" class="btn btn-primary"><%= t 'bai_viet_moi'%></a>
				</div>
				<div class="span6 text-right">
					<a href="<%= url_for :loc => (params[:loc].present? ? nil : 'da_xoa') %>" class="btn btn-small"><%= params[:loc].present? ? t('bai_viet_chua_xoa') : t('bai_viet_da_xoa')%></a>
				</div>
			</div>
			<%= form_tag url_for :action => "index", :id => 'dang_nhap' do %>
			<table class="table table-stripped">
				<thead>
					<tr>
						<th> # </th>
						<th> <%= t 'tieu_de_bai_viet'%> </th>
						<th> <%= t 'ngay_xuat_ban' %> </th>
						<th> <%= t 'nguoi_dang'%> </th>
						<th> <%= t 'xoa_bai_viet'%> <i class="icon-trash"></i></th>
					</tr>
				</thead>
				<tbody>
					<% i = @index_dau_tien + 1%>
					<% for bai_viet in @bai_viets%>
					<tr>
						<td> <%= i%>
						<% i = i + 1%> </td>
						<td>
							<span class="link_sua">
								<%= link_to bai_viet.tieu_de, :action => 'cap_nhat', :danh_muc => @danh_muc.slug, :id => bai_viet.id.to_s %>
							</span>
							<span class="link_xem">
								<a href="<%= url_for :action => 'index', :controller => '/bai_viet', :danh_muc_slug => @danh_muc.slug, :bai_viet_slug => bai_viet.slug %>" title="<%= t'xem_bai_viet' %>"><i class='icon-signin'></i></a>
							</span>
						</td>
						<td>
							<%= bai_viet.created_at.present? ? bai_viet.created_at.strftime('%Y/%m/%d %H:%M:%S') : ""%>
						</td>
						<td>
							<img class="img-rounded" src="<%= gravatar_url(bai_viet.nguoi_dung.email, 32)%>" /> <%= bai_viet.nguoi_dung.ten_hien_thi %>
						</td>
						<td>
							<% if !['da_xoa'].include?(params[:loc])%>
							<a href="<%= url_for :action => 'xoa', :uid => bai_viet.id %>" onclick="return confirm('<%= t 'ban_co_chac_chan_muon_xoa'%>')"> <%= t 'xoa_bai_viet'%> </a>
							<% else %>
							<a href="<%= url_for :action => 'khong_xoa', :uid => bai_viet.id %>"> <%= t 'phuc_hoi_bai_viet'%> </a>
							<% end %>
						</td>
					</tr>

					<% end %>
				</tbody>
			</table>
			<div>
				<div class="span4 pull-right">
					<div class="pager">
						<% if @co_trang_truoc %>
						<li class="previous">
							<a href="<%= url_for :loc => params[:loc], :page => @trang - 1%>">&larr; <%= t 'trang_truoc'%></a>
						</li>
						<%end %>
						<% if @co_trang_sau %>
						<li class="next">
							<a href="<%= url_for :loc => params[:loc], :page => @trang + 1%>"><%= t 'trang_sau'%> &rarr;</a>
						</li>
						<%end %>
					</div>
				</div>
				<div class="clearfix"></div>
			</div>
			<% end %>
		</div>
	</div>
</div>
